package db_main

import (
	"fmt"
	"longmen/server/config/global"
	"longmen/server/pkg/common/helper/util"
	"longmen/server/pkg/db/mysql/models/models_main"
)

// GetBlackKeyword 获取风控的禁言词汇
func GetBlackKeyword() ([]string, error) {
	fName := "GetBlackKeyword"
	var keywords []string
	err := global.GetR().Model(&models_main.BlackKeyword{}).Pluck("keyword", &keywords).Error
	if err != nil {
		return nil, fmt.Errorf("%s%s", util.Convert(fName), err.Error())
	}
	return keywords, nil
}
